<div class="row-content am-cf" ng-controller="BorrowerMngrEditCtrl">

    <div class="row">

        <div class="am-u-sm-12 am-u-md-12 am-u-lg-12">
            <div class="widget am-cf">
                <div class="widget-head am-cf">
                    <div class="widget-title am-fl">编辑图书借阅信息</div>
                    <div class="widget-function am-fr">
                        <a href="javascript:;" class="am-icon-cog"></a>
                    </div>
                </div>
                <div class="widget-body am-fr">

                    <form class="am-form tpl-form-line-form" name="editForm" novalidate>
                        <div class="am-form-group" ng-class="{ 'am-form-error': editForm.borrowerName.$invalid }">
                            <!--ng-class="{ 'am-form-error': editForm.borrower_name.$invalid && !editForm.borrower_name.$pristine }"-->
                            <label for="borrower_name" class="am-u-sm-3 am-form-label">借阅人<span style="color:red;">*</span> <span class="tpl-form-line-small-title">Name</span></label>
                            <div class="am-u-sm-9">

                                <input type="text" class="am-form-field " name="borrowerName" placeholder="请选择借阅人" title="请选择借阅人" ng-model="borrowerModel.borrowerName" required readonly ng-click="openModel()">
                                <small>请选择借阅人。</small>
                            </div>
                        </div>
                        <div class="am-form-group" ng-class="{ 'am-form-error': editForm.bookName.$invalid }">
                            <!--ng-class="{ 'am-form-error': editForm.borrower_name.$invalid && !editForm.borrower_name.$pristine }"-->
                            <label for="borrower_name" class="am-u-sm-3 am-form-label">选择图书<span style="color:red;">*</span> <span class="tpl-form-line-small-title">Book Name</span></label>
                            <div class="am-u-sm-9">
                                <input type="text" class="tpl-form-input am-form-field" name="bookName" placeholder="请选择图书" title="请选择图书" ng-model="bookModel.name"required readonly ng-click="openBookModel()">
                                <small>请选择图书。</small>
                            </div>
                        </div>

                        <div class="am-form-group">
                            <div class="am-u-sm-9 am-u-sm-push-3">
                                <button type="button" class="am-btn am-btn-primary tpl-btn-bg-color-success " ng-click="save()" ng-disabled="editForm.$invalid">提交</button>
                                <button type="button" class="am-btn am-btn-default" ng-click="back()">返回</button>
                            </div>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
    <!-- 新增弹出框 -->
    <script type="text/ng-template" id="myModalContent.html">

        <div class="modal-header">
            <h3 class="modal-title">选择借阅人</h3>
        </div>
        <div class="modal-body">

            <!--<div ng-include="/app/view/templet/selectBorrower.html"></div>-->
            <div class="row">
                <div class="am-u-sm-12 am-u-md-12 am-u-lg-12">
                    <div class="widget am-cf">

                        <div class="widget-body  widget-body-lg am-fr">
                            <div class="am-u-sm-12 am-u-md-6 am-u-lg-5">
                                <div class="am-form-group">
                                    <div class="am-btn-toolbar">
                                        <div class="am-btn-group am-btn-group-xs">
                                        </div>
                                    </div>
                                </div>
                            </div>
                            <div class="am-u-sm-12 am-u-md-6 am-u-lg-3">
                                <div class="am-form-group tpl-table-list-select">
                                    <!--<select data-am-selected="{btnSize: 'sm'}" title="请选择借阅人性别" style="color:darkslategrey; line-height:33px; height:33px;" ng-model="filter.gender">
                                <option value="">请选择借阅人性别</option>
                                <option value="1">女</option>
                                <option value="2">男</option>
                            </select>-->
                                </div>
                            </div>
                            <div class="am-u-sm-12 am-u-md-12 am-u-lg-3">
                                <div class="am-input-group am-input-group-sm tpl-form-border-form cl-p">
                                    <input type="text" class="am-form-field " placeholder="请输入借阅人姓名" title="请输入借阅人姓名" ng-model="filter.borrowerName">
                                    <span class="am-input-group-btn">
                                        <button class="am-btn  am-btn-default am-btn-success tpl-table-list-field am-icon-search" type="button" ng-click="reflash()"></button>
                                    </span>
                                </div>
                            </div>
                            <div class="am-u-sm-12">
                                <table ng-table="tableParams" class="am-table am-table-compact tpl-table-black " id="data-table" template-pagination="template/pagination.html">
                                    <thead>
                                        <tr>
                                            <th style="text-align:left;">姓名</th>
                                            <th style="text-align:left;">性别</th>
                                            <th style="text-align:left;">手机号</th>
                                            <th style="text-align:left;">邮箱</th>
                                            <th style="text-align:left;">家庭关系</th>
                                            <th style="text-align:left;">诚信记录</th>
                                            <th style="text-align:left;">创建日期</th>
                                            <th style="text-align:left;"></th>
                                        </tr>
                                    </thead>
                                    <tbody>
                                        <tr class="gradeX" ng-repeat="item in $data">
                                            <td>{{item.borrowerName}}</td>
                                            <td><span ng-if="item.gender==1">女</span><span ng-if="item.gender==2">男</span></td>
                                            <td>{{item.cellphone}}</td>
                                            <td>{{item.email}}</td>
                                            <td>{{item.relationship}}</td>
                                            <td><span ng-if="item.record==1">及时归还</span><span ng-if="item.record==2">延迟归还</span></td>
                                            <td>{{item.cTime|date:'yyyy-MM-dd hh:mm:ss'}}</td>
                                            <td>
                                                <div class="tpl-table-black-operation">
                                                    <a href="javascript:;" ng-click="select(item)">
                                                        <i class="am-icon-check"></i> 选择
                                                    </a>
                                                </div>
                                            </td>
                                        </tr>

                                        <!-- more data -->
                                    </tbody>
                                </table>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <div class="modal-footer">
            <button class="am-btn am-btn-warning" type="button" ng-click="cancel()">关闭</button>
        </div>

    </script>
    <!-- 新增弹出框 -->
    <script type="text/ng-template" id="myBookModalContent.html">

        <div class="modal-header">
            <h3 class="modal-title">选择图书</h3>
        </div>
        <div class="modal-body">

            <!--<div ng-include="/app/view/templet/selectBorrower.html"></div>-->
            <div class="row">
                <div class="am-u-sm-12 am-u-md-12 am-u-lg-12">
                    <div class="widget am-cf">

                        <div class="widget-body  widget-body-lg am-fr">
                            <div class="am-u-sm-12 am-u-md-6 am-u-lg-5">
                                <div class="am-form-group">
                                    <div class="am-btn-toolbar">
                                        <div class="am-btn-group am-btn-group-xs">
                                        </div>
                                    </div>
                                </div>
                            </div>
                            <div class="am-u-sm-12 am-u-md-6 am-u-lg-3">
                                <div class="am-form-group tpl-table-list-select">
                                    <!--<select data-am-selected="{btnSize: 'sm'}" title="请选择借阅人性别" style="color:darkslategrey; line-height:33px; height:33px;" ng-model="filter.gender">
                                        <option value="">请选择借阅人性别</option>
                                        <option value="1">女</option>
                                        <option value="2">男</option>
                                    </select>-->
                                </div>
                            </div>
                            <div class="am-u-sm-12 am-u-md-12 am-u-lg-12">
                                <div class="am-u-sm-12 am-u-md-12 am-u-lg-2">
                                    <div class="am-input-group am-input-group-sm tpl-form-border-form cl-p">
                                        <input type="text" class="am-form-field " placeholder="请输入关键字进行查询" title="请输入关键字进行查询" ng-model="filter.name">
                                    </div>
                                </div>
                                <!--<div class="am-u-sm-12 am-u-md-12 am-u-lg-2">
                                    <div class="am-input-group am-input-group-sm tpl-form-border-form cl-p">
                                        <input type="text" class="am-form-field " placeholder="请输入作者" title="请输入作者" ng-model="filter.author">
                                    </div>
                                </div>
                                <div class="am-u-sm-12 am-u-md-12 am-u-lg-2">
                                    <div class="am-input-group am-input-group-sm tpl-form-border-form cl-p">
                                        <input type="text" class="am-form-field " placeholder="请输入ISBN号" title="请输入ISBN号" ng-model="filter.isbn">
                                    </div>
                                </div>
                                <div class="am-u-sm-12 am-u-md-12 am-u-lg-2">
                                    <div class="am-input-group am-input-group-sm tpl-form-border-form cl-p">
                                        <input type="text" class="am-form-field " placeholder="请输入图书语言" title="请输入图书语言" ng-model="filter.language">
                                    </div>
                                </div>
                                <div class="am-u-sm-12 am-u-md-12 am-u-lg-2">
                                    <div class="am-input-group am-input-group-sm tpl-form-border-form cl-p">
                                        <input type="text" class="am-form-field " placeholder="请输入出版社" title="请输入出版社" ng-model="filter.publisher">
                                    </div>
                                </div>
                                <div class="am-u-sm-12 am-u-md-12 am-u-lg-1">
                                    <div class="am-input-group am-input-group-sm tpl-form-border-form cl-p">
                                        <button type="button" class="am-btn am-btn-sm am-btn-success am-icon-search" ng-click="reflash()"> 查询</button>
                                    </div>
                                </div>-->
                            </div>
                            <div class="am-u-sm-12">
                                <table ng-table="tableParams" class="am-table am-table-compact tpl-table-black " id="data-table" template-pagination="template/pagination.html">
                                    <thead>
                                        <tr>
                                            <th style="text-align:left;">图书名称</th>
                                            <th style="text-align:left;">作者</th>
                                            <th style="text-align:left;">ISBN</th>
                                            <th style="text-align:left;">语种</th>
                                            <th style="text-align:left;">出版社</th>
                                            <th style="text-align:left;">创建日期</th>
                                            <th style="text-align:left;"></th>
                                        </tr>
                                    </thead>
                                    <tbody>
                                        <tr class="gradeX" ng-repeat="item in $data|filter:filter.name">
                                            <td>{{item.name}}</td>
                                            <td>{{item.author}}</td>
                                            <td>{{item.isbn}}</td>
                                            <td>{{item.language}}</td>
                                            <td>{{item.publisher}}</td>
                                            <td>{{item.cTime|date:'yyyy-MM-dd hh:mm:ss'}}</td>
                                            <td>
                                                <div class="tpl-table-black-operation">
                                                    <a href="javascript:;" ng-click="select(item)">
                                                        <i class="am-icon-check"></i> 选择
                                                    </a>
                                                </div>
                                            </td>
                                        </tr>

                                        <!-- more data -->
                                    </tbody>
                                </table>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <div class="modal-footer">
            <button class="am-btn am-btn-warning" type="button" ng-click="cancel()">关闭</button>
        </div>

    </script>
</div>
